-
Notifications
You must be signed in to change notification settings - Fork 123
[HTTP2ConnectionPool] added HTTP2StateMachine
#447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
660ae31
to
a8679bf
Compare
Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+HTTP2StateMachine.swift
Outdated
Show resolved
Hide resolved
Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+HTTP2StateMachine.swift
Show resolved
Hide resolved
5d14a76
to
810d927
Compare
Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+HTTP2StateMachine.swift
Outdated
Show resolved
Hide resolved
Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+HTTP2StateMachine.swift
Outdated
Show resolved
Hide resolved
/// | ||
/// - Complexity: O(*k*), where *k* is the number of elements removed. | ||
fileprivate mutating func popFirst(max: Int) -> [Element] { | ||
precondition(max >= 0, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a message, or remove the empty string :)
// If there aren't any more connections, everything is shutdown | ||
let isShutdown: StateMachine.ConnectionAction.IsShutdown | ||
let unclean = !(cleanupContext.cancel.isEmpty && waitingRequests.isEmpty) | ||
if self.connections.isEmpty { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to check if we have still running http1 connections here.
810d927
to
45225b9
Compare
case keepConnection | ||
} | ||
|
||
func migrateToHTTP2(_ context: inout HTTP1Connections.HTTP2ToHTTP1MigrationContext) -> MigrateAction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says migrate to HTTP/2, but the type here is HTTP2toHTTP1 (the other direction). Which way are we going?
import NIOHTTP2 | ||
|
||
extension HTTPConnectionPool { | ||
struct HTTP2StateMaschine { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
struct HTTP2StateMaschine { | |
struct HTTP2StateMachine { |
Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+RequestQueue.swift
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think we can merge this.
1751208
to
a1fc238
Compare
981ee6f
to
2e15b58
Compare
@swift-server-bot test this please |
One step closer to support HTTP/2 in the new connection pool.
HTTP2StateMaschine
will be integrated inHTTPConnectionPool.StateMachine
in a follow up PR.